revealer: Respect gtk-enable-animations setting
authorChristian Persch <chpe@gnome.org>
Mon, 18 Nov 2013 20:21:49 +0000 (21:21 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 19 Nov 2013 04:01:11 +0000 (23:01 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=712632

gtk/gtkrevealer.c

index d872fcdcf3551f5ebc702ceda1d5e6c99f63a082..8ecff6c95fcdbe9485685ae2519a47b5974d83eb 100644 (file)
@@ -41,6 +41,9 @@
  * The style of transition can be controlled with
  * gtk_revealer_set_transition_type().
  *
+ * These animations respect the #GtkSettings::gtk-enable-animations
+ * setting.
+ *
  * The GtkRevealer widget was added in GTK+ 3.10.
  */
 
@@ -268,6 +271,13 @@ static GtkRevealerTransitionType
 effective_transition (GtkRevealer *revealer)
 {
   GtkRevealerPrivate *priv = gtk_revealer_get_instance_private (revealer);
+  gboolean animations_enabled;
+
+  g_object_get (gtk_widget_get_settings (GTK_WIDGET (revealer)),
+                "gtk-enable-animations", &animations_enabled,
+                NULL);
+  if (!animations_enabled)
+    return GTK_REVEALER_TRANSITION_TYPE_NONE;
 
   if (gtk_widget_get_direction (GTK_WIDGET (revealer)) == GTK_TEXT_DIR_RTL)
     {